
@extends('admin.layouts.app')

@section('title')
系统设置
@endsection

<!-- 侧边栏 -->
@section('sidebar')
@include('admin.setting.menu')
@endsection

<!--  -->
@section('content')
<!-- 直接使用组件名即可，定义好的变量可以通过类似html属性的方式传递 -->
<x-page_title title="系统配置" comment="配置系统中可用的开关和基础信息"></x-page_title>
<div class="row">
    <div class="col-12">
        <form method="post" action="{{ route('admin.setting') }}">
            @csrf
            @foreach ($settings as $setting)
            <div class="form-group row">
                 <label class="col-1 col-form-label">{{ $setting['name'] }}</label>
                 <div class="col-11">
                     <input type="text" class="form-control" name='settings[{{ $setting["key"] }}]' value='{{ $setting['value'] }}'>
                     <small class="form-text text-muted">{{ $setting['comment'] }}</small>
                 </div>
             </div>
            @endforeach
            <div class="form-group row">
                 <div class='offset-1'></div>
                 <div class="col-11">
                     <button type="submit" class="btn btn-primary">保存修改</button>
                 </div>
             </div>
        </form>
    </div>
</div>
@endsection